﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Phones.Client.Repository
{
    class DesignModeStatic
    {
        private static bool? _isInDesignMode;
        public static bool IsInDesignModeStatic
        {
            get
            {
                if (!_isInDesignMode.HasValue)
                {
#if SILVERLIGHT
                         _isInDesignMode = DesignerProperties.IsInDesignTool;
#else
                    var prop = DesignerProperties.IsInDesignModeProperty;
                    _isInDesignMode
                     = (bool)DependencyPropertyDescriptor
                     .FromProperty(prop, typeof(System.Windows.FrameworkElement))
                     .Metadata.DefaultValue;
#endif
                }

                return _isInDesignMode.Value;
            }
        }

    }
}
